<?php

/**
 * ecshop ERP v1.0
 * ----------------------------------------------------------------------------
 * http://www.phpally.com
 * Jacklee的博客 致力于php技术
 * ----------------------------------------------------------------------------
 * 作者: Jacklee
 * 邮箱: jack349392900@gmail.com
 * 创建时间: 2013-11-18
 * 最后修改时间: 2013-11-18
 */
 
define('IN_ECS', true);

require(dirname(__FILE__) . '/includes/init.php');
require_once(dirname(__FILE__) . '/includes/lib/lib_erp_common.php');
require_once(dirname(__FILE__) . '/includes/lib/lib_erp_warehouse.php');


if ($_REQUEST['act'] == 'get_warehousing_style')
{
	include('../includes/cls_json.php');
	$json  = new JSON;
	
	//检查是否有查看仓库的权限
	if(!admin_priv('erp_warehouse_view', '', false))
	{
		$result['error']=1;
		$result['message']=$_LANG['erp_no_permit'];
		die($json->encode($result));
	}
	
	$sql="select warehousing_style_id,warehousing_style from ".$GLOBALS['ecs']->table('erp_warehousing_style')." where is_valid='1'";
	$warehousing_style=$GLOBALS['db']->getAll($sql);
	
	//print_r($warehousing_style);
	
	$result['error']=0;
	$result['warehousing_style']=$warehousing_style;
	die($json->encode($result));		
}


elseif ($_REQUEST['act'] == 'get_delivery_style')
{
	include('../includes/cls_json.php');
	$json  = new JSON;
	
	//检查是否有查看仓库的权限
	if(!admin_priv('erp_warehouse_view', '', false))
	{
		$result['error']=1;
		$result['message']=$_LANG['erp_no_permit'];
		die($json->encode($result));
	}
	
	$sql="select delivery_style_id,delivery_style  from ".$GLOBALS['ecs']->table('erp_delivery_style')." where is_valid='1'";
	$delivery_style=$GLOBALS['db']->getAll($sql);
	
	//print_r($delivery_style) ;
	
	$result['error']=0;
	$result['delivery_style']=$delivery_style;
	die($json->encode($result));		
}

?>